import request from '@/utils/request'

export const userApi = {
    login: (data) => request.post('/auth/login', data),
    register: (data) => request.post('/auth/register', data),
    getUserInfo: () => request.get('/user/info'),
    updateProfile: (data) => request.put('/user/profile', data),
    getProductStatistics: () => request.get('/user/product-statistics')
}

export const productApi = {
    getProducts: () => request.get('/products'),
    addProduct: (data) => request.post('/products', data),
    updateProduct: (id, data) => request.put(`/products/${id}`, data),
    deleteProduct: (id) => request.delete(`/products/${id}`),
    toggleProductStatus: (id) => request.post(`/products/${id}/toggle-status`)
} 